var $$ = {};
function $(id){
  if(!$$[id]){
    $$[id] = document.getElementById(id);
  }
  return $$[id];
}


function volumeMagnify() {
  changeVolume(true);
}

function volumeMinish() {
  changeVolume(false);
}

function changeVolume(flag) {
  var volume = parseInt(top.mp.getVolume());
  //top.resetOSDInfoTimer();
  if (volume <= 100) {
    var mute = top.mp.getMuteFlag();
    if (mute == 1) {
      top.mp.setMuteFlag(0);
    }
    volume = flag ? volume + 5 : volume - 5;
    top.mp.setVolume(volume);
  }
}

function back(){
  top.mp.leaveChannel(top.mp.getChannelNum());
  top.mp.stop;
  window.history.back();
}
function pageMute() {
  //top.jsHideOSD();
  var muteState = top.mp.getMuteFlag();
  var vol = parseInt(top.mp.getVolume());

  if (muteState == 0) {
    top.mp.setMuteFlag(1);
  } else if (vol != 0) {
    top.mp.setMuteFlag(0);
    top.mp.setVolume(mp.getVolume());
  }
}

function audioTrack() {
  //top.resetOSDInfoTimer();
  top.mp.switchAudioChannel();
}

function showChannelNumber(channelNum){
  if (channelNum != null && channelNum != undefined){
    top.mainWin.document.all.channelNumber.innerHTML = channelNum;
  }
}

function clearChannelNumber(){
  top.mainWin.document.all.channelNumber.innerHTML = "";
}

function goTo(url, doc)
{
  doc.location.href = url;
}

function exitPage(){
  top.doStop();
}










